# 指定需要cmake的最低版本
cmake_minimum_required(VERSION 3.20.0)

# 将应用中的boards加入到Zephyr中
list(APPEND BOARD_ROOT ${CMAKE_SOURCE_DIR})

# 通过cmake package加入Zephyr构建系统
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

# 指定应用工程名称为zpro，必须在find_package后
project(zpro)

# 将应用的代码加入构建，必须在find_package后
target_sources(app PRIVATE src/main.c)

target_sources_ifdef(CONFIG_LOGGING_SAMPLE app PRIVATE  src/logging_sample.c
                                                        src/log_sample/simple.c
                                                        src/log_sample/simple_co.c
                                                        src/log_sample/simple_header.c
                                                        src/log_sample/custom_backend.c
                                                        src/log_sample/sample_instance.c)

target_sources_ifdef(CONFIG_NVS_SAMPLE app PRIVATE  src/nvs_sample.c)

target_sources_ifdef(CONFIG_SHELL_SAMPLE app PRIVATE  src/shell_sample.c)

target_sources_ifdef(CONFIG_KERNEL_SAMPLE app PRIVATE  src/workq_sample.c)